<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/incomingdata/IncomingData.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/incomingdata/IncomingData.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '来料数据',
                name: 'incomingdata/IncomingData',
                url: "/IncomingData/",
                sortName: "CreateDate",
                foreignKey:null
            });
            const editFormFields = ref({"MaterialBoxNo":"","OrderNumber":"","MaterialName":"","BatchNumber":"","ActualWeight":"","MaterialType":"","ExternalWarehouseNo":"","CreateDate":"","State":""});
            const editFormOptions = ref([[{"title":"料箱号","field":"MaterialBoxNo","disabled":true},
                               {"title":"订单号","field":"OrderNumber","disabled":true},
                               {"title":"物料名称","field":"MaterialName","disabled":true}],
                              [{"title":"批号","field":"BatchNumber","disabled":true},
                               {"title":"实际重量","field":"ActualWeight","disabled":true,"type":"decimal"},
                               {"dataKey":"来料类型","data":[],"title":"物料类型","field":"MaterialType","disabled":true,"type":"select"}],
                              [{"title":"外库单号","field":"ExternalWarehouseNo","disabled":true},
                               {"title":"创建时间","field":"CreateDate","disabled":true},
                               {"title":"状态","field":"State","disabled":true,"type":"number"}]]);
            const searchFormFields = ref({"MaterialBoxNo":"","OrderNumber":"","Types":"","BatchNumber":"","MaterialType":"","ExternalWarehouseNo":"","CreateDate":"","State":""});
            const searchFormOptions = ref([[{"title":"订单号","field":"OrderNumber"},{"title":"领料单号","field":"Types"},{"title":"批号","field":"BatchNumber"}],[{"title":"料箱号","field":"MaterialBoxNo"},{"title":"外库单号","field":"ExternalWarehouseNo"},{"title":"创建时间","field":"CreateDate","type":"datetime"}],[{"dataKey":"来料类型","data":[],"title":"物料类型","field":"MaterialType","type":"select"},{"title":"状态","field":"State","type":"number"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'MaterialBoxNo',title:'料箱号',type:'string',width:110,readonly:true,align:'left',sort:true},
                       {field:'OrderNumber',title:'订单号',type:'string',link:true,width:110,readonly:true,align:'left'},
                       {field:'MaterialName',title:'物料名称',type:'string',width:110,readonly:true,align:'left'},
                       {field:'Types',title:'领料单号',type:'string',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'BatchNumber',title:'批号',type:'string',width:110,readonly:true,align:'left'},
                       {field:'ActualWeight',title:'实际重量',type:'decimal',width:110,readonly:true,align:'left'},
                       {field:'MaterialType',title:'物料类型',type:'string',bind:{ key:'来料类型',data:[]},width:110,readonly:true,align:'left'},
                       {field:'ExternalWarehouseNo',title:'外库单号',type:'string',width:110,readonly:true,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,readonly:true,align:'left',sort:true},
                       {field:'State',title:'状态',type:'int',width:110,readonly:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
